package com.bsj.media.media.resample.quality;

public class QualityMapping {

	public int base_length;
	public int oversample;
	public float downsample_bandwidth;
	public float upsample_bandwidth;
	public FuncDef window_func;
	
	public static QualityMapping[] setQualityMap(FuncDef KAISER12, FuncDef KAISER10, 
			FuncDef KAISER8, FuncDef KAISER6){
			
		QualityMapping[] qualityMap = new QualityMapping[11];
		
		//{  8,  4, 0.830f, 0.860f, KAISER6 }, /* Q0 */
		qualityMap[0] = new QualityMapping();
		qualityMap[0].base_length = 8;
		qualityMap[0].oversample = 4;
		qualityMap[0].downsample_bandwidth = 0.830f;
		qualityMap[0].upsample_bandwidth = 0.860f;
		qualityMap[0].window_func = KAISER6;

		//{ 16,  4, 0.850f, 0.880f, KAISER6 }, /* Q1 */
		qualityMap[1] = new QualityMapping();
		qualityMap[1].base_length = 16;
		qualityMap[1].oversample = 4;
		qualityMap[1].downsample_bandwidth = 0.850f;
		qualityMap[1].upsample_bandwidth = 0.880f;
		qualityMap[1].window_func = KAISER6;

		//{ 32,  4, 0.882f, 0.910f, KAISER6 }, /* Q2 */  /* 82.3% cutoff ( ~60 dB stop) 6  */
		qualityMap[2] = new QualityMapping();
		qualityMap[2].base_length = 32;
		qualityMap[2].oversample = 4;
		qualityMap[2].downsample_bandwidth = 0.882f;
		qualityMap[2].upsample_bandwidth = 0.910f;
		qualityMap[2].window_func = KAISER6;

		//{ 48,  8, 0.895f, 0.917f, KAISER8 }, /* Q3 */  /* 84.9% cutoff ( ~80 dB stop) 8  */
		qualityMap[3] = new QualityMapping();
		qualityMap[3].base_length = 48;
		qualityMap[3].oversample = 8;
		qualityMap[3].downsample_bandwidth = 0.895f;
		qualityMap[3].upsample_bandwidth = 0.917f;
		qualityMap[3].window_func = KAISER8;

		//{ 64,  8, 0.921f, 0.940f, KAISER8 }, /* Q4 */  /* 88.7% cutoff ( ~80 dB stop) 8  */
		qualityMap[4] = new QualityMapping();
		qualityMap[4].base_length = 64;
		qualityMap[4].oversample = 8;
		qualityMap[4].downsample_bandwidth = 0.921f;
		qualityMap[4].upsample_bandwidth = 0.940f;
		qualityMap[4].window_func = KAISER8;

		//{ 80, 16, 0.922f, 0.940f, KAISER10}, /* Q5 */  /* 89.1% cutoff (~100 dB stop) 10 */
		qualityMap[5] = new QualityMapping();
		qualityMap[5].base_length = 80;
		qualityMap[5].oversample = 16;
		qualityMap[5].downsample_bandwidth = 0.922f;
		qualityMap[5].upsample_bandwidth = 0.940f;
		qualityMap[5].window_func = KAISER10;

		//{ 96, 16, 0.940f, 0.945f, KAISER10}, /* Q6 */  /* 91.5% cutoff (~100 dB stop) 10 */
		qualityMap[6] = new QualityMapping();
		qualityMap[6].base_length = 96;
		qualityMap[6].oversample = 16;
		qualityMap[6].downsample_bandwidth = 0.940f;
		qualityMap[6].upsample_bandwidth = 0.945f;
		qualityMap[6].window_func = KAISER10;

		//{128, 16, 0.950f, 0.950f, KAISER10}, /* Q7 */  /* 93.1% cutoff (~100 dB stop) 10 */
		qualityMap[7] = new QualityMapping();
		qualityMap[7].base_length = 128;
		qualityMap[7].oversample = 16;
		qualityMap[7].downsample_bandwidth = 0.950f;
		qualityMap[7].upsample_bandwidth = 0.950f;
		qualityMap[7].window_func = KAISER10;

		//{160, 16, 0.960f, 0.960f, KAISER10}, /* Q8 */  /* 94.5% cutoff (~100 dB stop) 10 */
		qualityMap[8] = new QualityMapping();
		qualityMap[8].base_length = 160;
		qualityMap[8].oversample = 16;
		qualityMap[8].downsample_bandwidth = 0.960f;
		qualityMap[8].upsample_bandwidth = 0.960f;
		qualityMap[8].window_func = KAISER10;

		//{192, 32, 0.968f, 0.968f, KAISER12}, /* Q9 */  /* 95.5% cutoff (~100 dB stop) 10 */
		qualityMap[9] = new QualityMapping();
		qualityMap[9].base_length = 192;
		qualityMap[9].oversample = 32;
		qualityMap[9].downsample_bandwidth = 0.968f;
		qualityMap[9].upsample_bandwidth = 0.968f;
		qualityMap[9].window_func = KAISER12;

		//{256, 32, 0.975f, 0.975f, KAISER12}, /* Q10 */ /* 96.6% cutoff (~100 dB stop) 10 */
		qualityMap[10] = new QualityMapping();
		qualityMap[10].base_length = 256;
		qualityMap[10].oversample = 32;
		qualityMap[10].downsample_bandwidth = 0.975f;
		qualityMap[10].upsample_bandwidth = 0.975f;
		qualityMap[10].window_func = KAISER12;


		return qualityMap;
	}
}
